UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DunsC9EcJ4WtpGWgEfcLB+T4fPbk+vt+XAFSvTeLwpA=' 
WHERE 
  key_id = '6dadbd06f7f62356fea989325cf950678cfd9b296c6ce76a6e08a5d380376283' 
  AND (
    token = 'DunsC9EcJ4WtpGWgEfcLB+T4fPbk+vt+XAFSvTeLwpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047