UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CxgL9NgnedE6reFWKzjTDeUmNaIbqeq+z6nnpSK3tvA=' 
WHERE 
  key_id = '57e91d6130ae5a717a7fc9afe231f384661248d5bac6c6824b08d830fd7eba0c' 
  AND (
    token = 'CxgL9NgnedE6reFWKzjTDeUmNaIbqeq+z6nnpSK3tvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021