UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pBps4UxxL8uCtO8EQegq/CTnc7S7ZQqUjv2n+DPmxTE=' 
WHERE 
  key_id = '2dea3022aaf00cc97f59654c94d371bb60a7f946ec6f01b6ff5f75291b0b1b79' 
  AND (
    token = 'pBps4UxxL8uCtO8EQegq/CTnc7S7ZQqUjv2n+DPmxTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024