UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IrVsLrAcPJZsP0vVhBVAdE9jlAdXO+YDyDmSYZnv56E=' 
WHERE 
  key_id = 'bdce34af22acf6885744939c175cda3d505f3ec71d5835dfc1ee32f17602e46e' 
  AND (
    token = 'IrVsLrAcPJZsP0vVhBVAdE9jlAdXO+YDyDmSYZnv56E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018