UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BHR3unceDTbi0/2xazDzNbp7NgPq+LYm6NdLBnNF4kM=' 
WHERE 
  key_id = 'c551b78ca00b1160221ee45b2edf22b86009bc37bfc88fc8395959f27eaf6511' 
  AND (
    token = 'BHR3unceDTbi0/2xazDzNbp7NgPq+LYm6NdLBnNF4kM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044