UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gYYAobj19Qqkf9O5z/xr34bEBtdLpTz1lbaeTFEwC6M=' 
WHERE 
  key_id = '7ad61940e7c82d9dabded162ecc6bf0629c9134dc69069f75d9f4d818e0a9002' 
  AND (
    token = 'gYYAobj19Qqkf9O5z/xr34bEBtdLpTz1lbaeTFEwC6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049