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

Query time 0.00029