UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f2vhWoJaOBSR3oF3x+SXsLDkJuBejbk+EbkgYeCkZfg=' 
WHERE 
  key_id = '5037857f3c06a1ce562e9997f42bce66810ff5b3cc30b63c955df9270df26d35' 
  AND (
    token = 'f2vhWoJaOBSR3oF3x+SXsLDkJuBejbk+EbkgYeCkZfg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025