UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lh8hgPUZuj1hReWHrFH5MbTmnn0gUmjNRZ+ChtOCT8Q=' 
WHERE 
  key_id = 'e29e915e82bf9cf3746ab9d62b13f7694cc8d52f7f37abd90258f3bc05ac4d31' 
  AND (
    token = 'Lh8hgPUZuj1hReWHrFH5MbTmnn0gUmjNRZ+ChtOCT8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028