UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZZeUrp5gnINkH2q81BF0UxoQEFUBYZbT2NxA804+Bjw=' 
WHERE 
  key_id = '9b07cb134112fa92e07ef3b877db7a65023f76a28b445ed33f6d2b6b3fd3a90d' 
  AND (
    token = 'ZZeUrp5gnINkH2q81BF0UxoQEFUBYZbT2NxA804+Bjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038