UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O/BwgZIMdlpcp7mpJKf3Jdy0zBujVmKd5hgMAUAz18A=' 
WHERE 
  key_id = '259c44e5ec2313cf957b31c393fea66774cfd57af79060bfe7553c4ca02b1a44' 
  AND (
    token = 'O/BwgZIMdlpcp7mpJKf3Jdy0zBujVmKd5hgMAUAz18A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017