UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4j5ROvcpFg3Arih3+hFjYC9njlwRHvTz7XzWxqh4IUk=' 
WHERE 
  key_id = 'c326de4c5d7f8275eb66206c63aebed0d13eaabdfaa37a344b62417c4a658820' 
  AND (
    token = '4j5ROvcpFg3Arih3+hFjYC9njlwRHvTz7XzWxqh4IUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037