UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'srP2+HvsumROAAI+ZfX96y9VDlgDkBQLBnnH7Fln9M8=' 
WHERE 
  key_id = '06d3da10a538bf68123bedbc1f17c681cc9a71257d995c674e9f4d9644bbff92' 
  AND (
    token = 'srP2+HvsumROAAI+ZfX96y9VDlgDkBQLBnnH7Fln9M8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028