UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BoeI7/I5Fu5q5VMwaQEqvuOYfvHzwgUOn7mSVboIDSY=' 
WHERE 
  key_id = 'acfa070c9da45615bde2eb6afe79aed9ec2caa4d8ff041a1a2bd554ac2f6fc51' 
  AND (
    token = 'BoeI7/I5Fu5q5VMwaQEqvuOYfvHzwgUOn7mSVboIDSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048