UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gn59NqzZuiB8GeJl6kTC6TpVEEOJ0Y/5bnR9FIh6k5c=' 
WHERE 
  key_id = '26553ca5112dcaff640b0781b6aa4d301617cf58eb858c37f03d25ffe6780beb' 
  AND (
    token = 'Gn59NqzZuiB8GeJl6kTC6TpVEEOJ0Y/5bnR9FIh6k5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034