UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4fZBvW1fuKbxJT9+7unYX70kZ+iSk9f/JuZHq0MfIHw=' 
WHERE 
  key_id = '225a7ca319e0e90b4a2e9bfe6bd0f895ef6323f0a9fcc1047d19549b4261ab0a' 
  AND (
    token = '4fZBvW1fuKbxJT9+7unYX70kZ+iSk9f/JuZHq0MfIHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016