UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1i93LtwGYNW0oOKi4ktwxWAT3p0lYkk806OvfAmSEms=' 
WHERE 
  key_id = '61d18c54706fb720b09b221c8743c31659a217e7aae738bd3fafe4e03dbf7be0' 
  AND (
    token = '1i93LtwGYNW0oOKi4ktwxWAT3p0lYkk806OvfAmSEms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047