UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jOhlVx1vgtUUfHmhW8D6hlOG2DuQT0VJfwpJgVcr4mo=' 
WHERE 
  key_id = '69d25f770b3f04e0780232d953aaada8461ec429b836d52c949adca01d8c5f21' 
  AND (
    token = 'jOhlVx1vgtUUfHmhW8D6hlOG2DuQT0VJfwpJgVcr4mo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034