UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KdtlwX/8aIrc8JCWGzo3476wFD9Of6GbD51wP7QycR8=' 
WHERE 
  key_id = 'ffc9ef8cd3aaa2930b4f2b8111a9a3ce11a3ed4a682857976a639f93fd6a9fac' 
  AND (
    token = 'KdtlwX/8aIrc8JCWGzo3476wFD9Of6GbD51wP7QycR8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026