UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LyRwDy+pzGaZPEnF2cfTVLC/umTxof4b4c4Gwzaho8I=' 
WHERE 
  key_id = '91e0c4893396b750dad1962a1b8cc1c61545d3ea70262d2d13c0f6bc4abba661' 
  AND (
    token = 'LyRwDy+pzGaZPEnF2cfTVLC/umTxof4b4c4Gwzaho8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016