UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pFo3mpayD+TuIFoaajUZOSuwGf5ITwaXRkQcqKYP9r8=' 
WHERE 
  key_id = 'c50ab25029fe5600803ae33b4f41124f07baa7bebf72ee39d9973088d5a0b369' 
  AND (
    token = 'pFo3mpayD+TuIFoaajUZOSuwGf5ITwaXRkQcqKYP9r8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034