UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WO0ej0KQ924HPLtol84eAkqaOzqkVF6aRnDofU2Di68=' 
WHERE 
  key_id = '8609667589d5543b5c90f715ae7a618cddc222deae9b70abed7455c7ccb0b434' 
  AND (
    token = 'WO0ej0KQ924HPLtol84eAkqaOzqkVF6aRnDofU2Di68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026