UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bcrk3KAeiRuxwz5j9DJ+PDHNKh4CPU7jJu3P/OkhGlc=' 
WHERE 
  key_id = '90f89763c4521e6b7b9ae9ab190fad20952a5dca8e4d06c276fbf05765615cc6' 
  AND (
    token = 'bcrk3KAeiRuxwz5j9DJ+PDHNKh4CPU7jJu3P/OkhGlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030