UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xNH/mEYwcQz19DTqgXaoxRX2VV1Li+aBXMi6NVj905A=' 
WHERE 
  key_id = '223d88dcfc358193ecdf4aa6cb0b2aca67e34ffeeca80c0bd2f001c501773388' 
  AND (
    token = 'xNH/mEYwcQz19DTqgXaoxRX2VV1Li+aBXMi6NVj905A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020