UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SNrq8oQKC9P0A9fuaWMxca0ZFt44v1CBcIPFxrAXv3c=' 
WHERE 
  key_id = 'f3ff2dc28c74c55d32b1c64710e1628d3d9a4b4b0cb8ff46b519606ae0b8afe6' 
  AND (
    token = 'SNrq8oQKC9P0A9fuaWMxca0ZFt44v1CBcIPFxrAXv3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036