UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gN2DGZ8dkoFiKjjHtgSwmmbEWXrjlSRcgYbCJVEEBtw=' 
WHERE 
  key_id = 'bfaaa23f6fa295aca0aa02711c1b6bddd7905134d636e56c18fe92e19a59b3ae' 
  AND (
    token = 'gN2DGZ8dkoFiKjjHtgSwmmbEWXrjlSRcgYbCJVEEBtw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019