UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PJoM1/LkjQdZbbu8L9PB5LEPs/J5rkjAMyguUYqLLJY=' 
WHERE 
  key_id = '69e540561290441ad79a14793177ecf37608b29eff911a5a1a99d1e185d187b7' 
  AND (
    token = 'PJoM1/LkjQdZbbu8L9PB5LEPs/J5rkjAMyguUYqLLJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035