UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rE+UtR4M1Qk5y3bSn8iIEhV5ce+IwHviGRYnA/pUkwE=' 
WHERE 
  key_id = '73d80887eedd8d5b584fda3b06db0b91f3563db21cda4b5193455eadbacbf089' 
  AND (
    token = 'rE+UtR4M1Qk5y3bSn8iIEhV5ce+IwHviGRYnA/pUkwE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021