UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F7T8PXQzRBvb+S1tK35IQ00Y9UYVvSZCdkkRxNSYigA=' 
WHERE 
  key_id = '1802cc23b838222dec125a6bb7b8d0e81a783a3d58cba210ab7f4139ad10b943' 
  AND (
    token = 'F7T8PXQzRBvb+S1tK35IQ00Y9UYVvSZCdkkRxNSYigA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015