UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+BnRdRnWXbJrfwgoQGsj/0jihC7Ue3i9rbNW4BH8EA4=' 
WHERE 
  key_id = 'c112b89451eba2501d17136f079b99734c4a85af9b6eba7e3a7831cd2353e403' 
  AND (
    token = '+BnRdRnWXbJrfwgoQGsj/0jihC7Ue3i9rbNW4BH8EA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031