UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C0VAnGHX4ngz9LRAj7F/rCoq8j2+wre7fTDN1q2ypQM=' 
WHERE 
  key_id = '08bb1cb08b6d3af441bcc9bcdec82614a4755e78362472a8f5fddf356d06a4f9' 
  AND (
    token = 'C0VAnGHX4ngz9LRAj7F/rCoq8j2+wre7fTDN1q2ypQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023