UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wgko8s86dqnq/TViKtB9B3Zm79Lopp3tGsATY3HmKfE=' 
WHERE 
  key_id = '1cd761ac584fa01ee2127c3708e8f6d02d7be680d2dc7b9b2752e9a76a6a5c03' 
  AND (
    token = 'wgko8s86dqnq/TViKtB9B3Zm79Lopp3tGsATY3HmKfE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054