UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't3AmdljfEkNaF2cHk7jBZDtRntI5JpnXfLbnDi0RTM8=' 
WHERE 
  key_id = '139422ac0c355959a4d7725195c30003e56c75195d23e5f33a091921f545d41a' 
  AND (
    token = 't3AmdljfEkNaF2cHk7jBZDtRntI5JpnXfLbnDi0RTM8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00084